﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[System.Serializable]
public class Stats
{
    [SerializeField] private int baseValue;

    // 用于实现增益效果（累加增益、百分比增益）
    public int buffsToSum = 0;
    public int buffsToMutiply = 0;

    public int GetValue()
    {
        // 获取数值时计算Buff
        int finalValue = baseValue;

        // 计算累加增益
        finalValue += buffsToSum;

        // 计算百分比增益
        finalValue = Mathf.RoundToInt(finalValue * (1 + buffsToMutiply * 0.01f));

        return finalValue;
    }

    public void SetDefaultValue(int value)
    {
        baseValue = value;
    }
    
}
